define(function(require, exports, module) {
    
    function ajax(_type, _url, _data, _success, _error) {
        jQuery.ajax({  
            type: _type,  
            url: _url,  
            data: _data || {},
            dataType: "json",
            cache: false,
            success: function(data){_success && _success(data);},
            error: function(e){_error && _error(e);}  
        });        
    }
      
    // 后台get请求接口
    var load = function(_url, _data, _success, _error){
        ajax('get', _url, _data, _success, _error);
    };
    
    // 后台post请求接口
    var post = function(_url, _data, _success, _error){
        ajax('post', _url, _data, _success, _error);
    };
    
    exports.load = load;
    exports.post = post;    
});  